import VueRouter from 'vue-router'
import HomeContainer from './components/tabbar/HomeContainer.vue'
import MenberContainer from './components/tabbar/MenberContainer.vue'
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue'
import SearchContainer from './components/tabbar/SearchContainer.vue'
import NewsList from './components/news/NewsList.vue'
import newsone from './components/newscontainer/NewsInfo.vue'
import photolist from './components/photolist/photolist.vue'
import photoInfo from './components/photolist/photoInfo.vue'
import goodslist from './components/goods/goodslist.vue'
import goodsinfo from './components/goods/goodsinfo.vue'
import goodsdesc from './components/goods/goodsdesc.vue'
import goodscomment from './components/goods/goodscomment.vue'
import writeMsg from './components/writes/writeMeg.vue'
// 3. 创建路由对象
var router = new VueRouter({
	routes: [
		//匹配路由规则
		{ path: '/', redirect: '/home' },
		{ path: '/home', component: HomeContainer },
		{ path: '/member', component: MenberContainer },
		{ path: '/shopcar', component: ShopcarContainer },
		{ path: '/search', component: SearchContainer },
		{ path: '/home/newslist', component: NewsList },
		{ path: '/home/newsinfo/:id', component: newsone },
		{ path: '/phtoto', component: photolist },
		{ path: '/home/photoinfo/:id', component: photoInfo },
		{ path: '/home/goodslist/', component: goodslist },
		{ path: '/home/goodsinfo/:id', component: goodsinfo, name: 'goodsinfo' },
		{ path: '/home/goodsdesc/:id', component: goodsdesc, name: 'goodsdesc' },
		{ path: '/home/goodscomment/:id', component: goodscomment, name: 'goodscomment' },
		{ path: '/home/write', component: writeMsg },
	],
	linkActiveClass: 'mui-active',
})

// 把路由对象暴露出去
export default router
